package com.zhihaoliang.baseframe;

import android.app.Application;

import com.zhihaoliang.baseframe.db.AppDatabase;
import com.zhihaoliang.baseframe.db.DataRepository;

/**
 * 创建日期：2020-02-24
 * 描述:Android的Application
 * 作者:支豪亮
 */
public class BasicApp extends Application {

    private AppExecutors mAppExecutor;

    @Override
    public void onCreate() {
        super.onCreate();

        mAppExecutor = new AppExecutors();
    }

    public AppDatabase getDatabase(){
        return AppDatabase.getInstance(this,mAppExecutor);
    }

    public DataRepository getRepository(){
        return DataRepository.getInstance(getDatabase());
    }
}
